dogfooding fixes: document StyleX build requirement for swizzled components#3475
Open
josephfarina wants to merge 1 commit into
Open
dogfooding fixes: document StyleX build requirement for swizzled components#3475josephfarina wants to merge 1 commit into
josephfarina wants to merge 1 commit into
Conversation
Swizzled components ship raw StyleX source that needs a build-time StyleX compiler; without one they render unstyled with no error. The swizzle command now prints a StyleX build-setup note after copying (with the Next.js caveat that the StyleX Babel plugin disables SWC and breaks next/font, so an SWC-based transform is required), and `astryx docs styling` gains a StyleX Build Setup section covering per-bundler setup. Fixes #3373
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
astryx swizzle <Component>copies a component's raw StyleX source into your app. That source needs a build-time StyleX compiler to produce atomic CSS — but nothing in the CLI output or docs said so, and there was no framework-specific setup guidance. Result: a freshly swizzled component compiles but renders unstyled, with no error, and it's non-obvious why. Fixes #3373.Changes
1. Post-copy CLI note (only when the swizzled source actually uses StyleX). The copy loop now detects
@stylexjs/stylexusage and, for StyleX components, prints:Components with no StyleX get no note (verified by a negative test). The
--jsonpayload also gains ausesStyleXboolean for machine consumers.2. Docs: a "StyleX Build Setup" section in
astryx docs styling. The issue noted that grepping the docs forbabel,swc,next.config,compiler,transform, orpluginreturned nothing. The new section covers:next/font— so an SWC-based transform (e.g. the community@stylexswc/nextjs-plugin) is the working path, with anext.configexample.apps/example-nextjs-stylexin the repo.defineTheme+astryx theme build) needs no StyleX compiler.Why point at
astryx docs stylingrather than a wiki pageThe issue mentioned
astryx docs swizzle, but there is noswizzledocs topic, and no StyleX-setup wiki page exists yet. Rather than invent a URL, this puts the setup content in the existingstylingdoc (which the issue explicitly named as a gap) and points the CLI note there.Verification
astryx swizzle Buttonin the monorepo: the StyleX note prints with the Next.js caveat and theastryx docs stylingpointer.astryx docs styling: the "StyleX Build Setup" section renders with the table, the Next.js note, and thenext.configexample.swizzle.routing.test.mjs: a StyleX component reportsusesStyleX: trueand prints the note (asserting the compiler requirement, theunstyledsymptom, thenext/fontcaveat, and the docs pointer); a non-StyleX component reportsusesStyleX: falseand prints no note.